{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4c3b027a",
   "metadata": {},
   "outputs": [],
   "source": [
    "#计算BMI指数\n",
    "\n",
    "height = float(input(\"请输入您的身高，单位为米\"))\n",
    "weight = float(input(\"请输入您的体重，单位为千克\"))\n",
    "bmi = weight/(height*height)\n",
    "print(\"您的BMI体重指数为\"+str(bmi))\n",
    "#判断身材是否合理\n",
    "if bmi<18.5:\n",
    "    print('过重')\n",
    "if bmi>=18.5 and bmi<24.9:\n",
    "    print('正常')\n",
    "if bmi>=24.9 and bmi<29.9:\n",
    "    print('过重')\n",
    "if bmi>=29.9:\n",
    "    print('肥胖')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7d4f0f7c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce881257",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
